1. Field of the Invention
The present invention relates to a method of and an apparatus for obtaining a binary image which can be employed in wiring-pattern inspection of printed circuit boards, for example.
2. Description of the Background Art
In an apparatus for inspecting wiring patterns on printed circuit boards, it is required to discriminate an image of a wiring pattern from a background image. Accordingly, an image signal of the printed board having gradation (hereinafter referred to as "an original image signal") is obtained and is compared with a threshold level to obtain a binary image having logical levels of "0" and "1". The binary image signal thus obtained represents the image of the wiring pattern.
In order to obtain an appropriate binary image of the wiring pattern, the threshold level should be carefully determined. Numerous approaches for determining the threshold level have been proposed, and one of the approaches is the method which is called the "adaptive thresholding method". In this method, an optimum threshold level is determined by analyzing results obtained by binarizing the original image with various threshold levels, respectively, and then selecting one of . the various threshold levels according to a predetermined criterion.
However, these conventional methods have a problem in that an enormous processing time is required to binarize the original image with all threshold levels and to calculate and index value for each of the resultant binary images.
To solve the problem, there has been proposed a method of calculating index values at high speeds through filter operations, in which the amount of calculations does not depend on the number of threshold levels. In this method, however, multi-level image memories are required. For high-speed processing, large-scale shift registers should be used as the multi-level image memories, for example, so that the total scale of the hardware therefor is increased.